// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.randomizedWorld.randomizedZoneStory;

import java.util.ArrayList;
import zombie.characters.IsoZombie;
import zombie.core.Rand;
import zombie.iso.IsoMetaGrid;
import zombie.vehicles.BaseVehicle;

public class RZSSexyTime extends RandomizedZoneStoryBase {
    private final ArrayList<String> pantsMaleItems = new ArrayList();
    private final ArrayList<String> pantsFemaleItems = new ArrayList();
    private final ArrayList<String> topItems = new ArrayList();
    private final ArrayList<String> shoesItems = new ArrayList();

    public RZSSexyTime() {
        this.name = "Sexy Time";
        this.chance = 5;
        this.minZoneHeight = 5;
        this.minZoneWidth = 5;
        this.zoneType.add(RandomizedZoneStoryBase.ZoneType.Beach.toString());
        this.zoneType.add(RandomizedZoneStoryBase.ZoneType.Forest.toString());
        this.zoneType.add(RandomizedZoneStoryBase.ZoneType.Lake.toString());
        this.shoesItems.add("Base.Shoes_Random");
        this.shoesItems.add("Base.Shoes_TrainerTINT");
        this.pantsMaleItems.add("Base.TrousersMesh_DenimLight");
        this.pantsMaleItems.add("Base.Trousers_DefaultTEXTURE_TINT");
        this.pantsMaleItems.add("Base.Trousers_Denim");
        this.pantsFemaleItems.add("Base.Skirt_Knees");
        this.pantsFemaleItems.add("Base.Skirt_Long");
        this.pantsFemaleItems.add("Base.Skirt_Short");
        this.pantsFemaleItems.add("Base.Skirt_Normal");
        this.topItems.add("Base.Shirt_FormalWhite");
        this.topItems.add("Base.Shirt_FormalWhite_ShortSleeve");
        this.topItems.add("Base.Tshirt_DefaultTEXTURE_TINT");
        this.topItems.add("Base.Tshirt_PoloTINT");
        this.topItems.add("Base.Tshirt_WhiteLongSleeveTINT");
        this.topItems.add("Base.Tshirt_WhiteTINT");
    }

    @Override
    public void randomizeZoneStory(IsoMetaGrid.Zone zone) {
        this.cleanAreaForStory(this, zone);
        BaseVehicle baseVehicle = this.addVehicle(
            zone, this.getSq(zone.pickedXForZoneStory, zone.pickedYForZoneStory, zone.z), null, null, "Base.VanAmbulance", null, null, null
        );
        if (baseVehicle != null) {
            baseVehicle.setAlarmed(false);
        }

        boolean boolean0 = Rand.Next(7) == 0;
        boolean boolean1 = Rand.Next(7) == 0;
        if (boolean0) {
            this.addItemsOnGround(zone, true, baseVehicle);
            this.addItemsOnGround(zone, true, baseVehicle);
        } else if (boolean1) {
            this.addItemsOnGround(zone, false, baseVehicle);
            this.addItemsOnGround(zone, false, baseVehicle);
        } else {
            this.addItemsOnGround(zone, true, baseVehicle);
            this.addItemsOnGround(zone, false, baseVehicle);
        }
    }

    private void addItemsOnGround(IsoMetaGrid.Zone var1, boolean _boolean, BaseVehicle baseVehicle) {
        byte _byte = 100;
        if (!_boolean) {
            _byte = 0;
        }

        ArrayList arrayList = this.addZombiesOnVehicle(1, "Naked", Integer.valueOf(_byte), baseVehicle);
        if (!arrayList.isEmpty()) {
            IsoZombie isoZombie = (IsoZombie)arrayList.get(0);
            this.addRandomItemOnGround(isoZombie.getSquare(), this.shoesItems);
            this.addRandomItemOnGround(isoZombie.getSquare(), this.topItems);
            this.addRandomItemOnGround(isoZombie.getSquare(), _boolean ? this.pantsMaleItems : this.pantsFemaleItems);
        }
    }
}
